/*
 * ebcd_dbg.c
 * Clunix, KyungWoon Cho, cezanne@clunix.com, 2006.1
 *
 * Copyright (c) 2001-2008 by Clunix Inc. All Rights Reserved.
 */

#include "config.h"

#include "ebc.h"
#include "ebcd.h"

#ifdef ECM_DEBUG

const char *
ebcd_dbg_pch(ebcd_pch_t *dpch)
{
	static char	buf[256];

	switch (dpch->type) {
	case LOCAL_PCH:
		if (!ecm_empty_str(dpch->pchp->name))
			ecm_snprintf(buf, 256, "<lpch:%s>", dpch->pchp->name);
		else
			ecm_snprintf(buf, 256, "<anonymous lpch:%x>", dpch->pchp->mdid);
		break;
	case EXT_PCH:
		ecm_snprintf(buf, 256, "<epch:%s/%s>", ebc_dbg_ndid(dpch->pchp->ndid), ecm_safe_str(dpch->pchp->name));
		break;
	case BDCAST_PCH:
		return "<bdcast>";
	}
	return buf;
}

#endif
